<template>
    <el-table :data="searchDataList" style="width: 100%">
        <el-table-column prop="wordid" label="关键词ID" />
        <el-table-column prop="keyword" label="关键词" />
        <el-table-column prop="num" label="Num" />
    </el-table>
</template>

<script setup lang="ts">
import type { AxiosResponse } from 'axios';
import { reactive } from 'vue';
import service from '../../../utils/service';

type TSearchData = {
    wordid: string,
    keyword: string,
    num: number
}

const searchDataList = reactive<TSearchData[]>([])

service({
    url: `/search/list`,

}).then((res: AxiosResponse) => {
    if (res.data.code === "200") {
        searchDataList.length = 0
        searchDataList.push(...res.data.data)
    }
})
</script>

<style scoped></style>